import { Entity, Column, PrimaryColumn } from 'typeorm';


/**
 * 阿里云 Rocketmq metric
 *
 */
@Entity(PluginAliyunMonitorRocketmqMetric.tableName)
export class PluginAliyunMonitorRocketmqMetric {

  static tableName = 'plugin_aliyun_monitor_rocketmq_metric';

  @PrimaryColumn({ comment: 'id，格式：instanceId + type + t' })
  id: string;
  @Column({ comment: '时间' })
  t: number;
  @Column({ comment: '阿里云Rocketmq集群 instanceId' })
  instanceId: string;
  @Column({ comment: '阿里云Rocketmq集群 instanceName' })
  instanceName: string;
  @Column({ comment: '阿里云Rocketmq 分组id' })
  groupId: string;
  @Column({ comment: '平均值' })
  average: number;
  @Column({ comment: '指标类型' })
  type: string;

}

export const PluginAliyunMonitorRocketmqMetricType = {
  ReceiveMessageCountPerInstance: 'ReceiveMessageCountPerInstance',// 	实例（Instance）每分钟接收消息数的数量
  SendMessageCountPerInstance: 'SendMessageCountPerInstance',// 	实例（Instance）每分钟发送消息数量
  ConsumerLag: 'ConsumerLag',// 消息堆积
};
